#pragma once

#include "VConfigs.hpp"

using namespace Zen;
using namespace Zen::Vap;

class VBlockCache
{
public:
	static VBlockCache * Get();

	VBlockCache();

	SharedTexture getTexture(int code);
protected:
	using SharedTexture = std::shared_ptr<Texture>;
	std::vector<SharedTexture> m_textures;
};

class VBlock : public Combination2D
{
public:
	LoadViewDeclare();
	
	void setBlockColorCode(int c);

	Size2 getViewSize() { return m_view_size; }
protected:
	Sprite * m_main;
	Size2 m_view_size;
	int m_color = 0;
};

class VTetrisBlocks : public Combination2D {
public:
	LoadViewDeclare();

	void setStatus(TetrisInfo info, bool centered = false);

protected:
	TetrisInfo m_info;
	VBlock* m_subs[GPotsMaxCount];
	bool m_is_centered = false;
};
